export default {
	getUserInfoData(store, json){
		return new Promise((resolve, reject) => {
			store.dispatch('requestData', {
				path:'/user/info',
				data:json
			}).then(res =>{
				resolve(res)
			}).catch(err => {
				reject(err)
			})
		})
	},
	getGoodData(store, json){
		return new Promise((resolve, reject) => {
			store.dispatch('requestData', {
				path:'/user/goods',
				data:json
			}).then(res =>{
				resolve(res)
			}).catch(err => {
				reject(err)
			})
		})
	},
	getFavData(store, json){
		return new Promise((resolve, reject) => {
			store.dispatch('requestData', {
				path:"/user/favs",
				data:json
			}).then(res => {
				resolve(res)
			}).catch(err => {
				reject(err)
			})
		})
	},
	getRegVICodeHandle(store, v) {
		return new Promise((resolve, reject) => {
			store.dispatch("requestData", {
				path: "/sms"
			}).then(v => {
				store.dispatch("requestData", {
					path: "/dotting",
					data: {
						name: "getRegVICodeHandle",
						api: "/sms"
					}
				})
				resolve(v)
			}).catch(v => {
				reject(v)
			})
		})
	},
	getSMSVICodeHandle(store, v) {
		return new Promise((resolve, reject) => {
			store.dispatch("requestData", {
				path: "/sms"
			}).then(v => {
				store.dispatch("requestData", {
					path: "/dotting",
					data: {
						name: "getSMSVICodeHandle",
						api: "/sms"
					}
				})
				resolve(v)
			}).catch(v => {
				reject(v)
			})
		})
	},
	getAccountVICodeHandle(store, v) {
		return new Promise((resolve, reject) => {
			store.dispatch("requestData", {
				path: "/sms"
			}).then(v => {
				store.dispatch("requestData", {
					path: "/dotting",
					data: {
						name: "getAccountVICodeHandle",
						api: "/sms"
					}
				})
				resolve(v)
			}).catch(v => {
				reject(v)
			})
		})
	},
	getFollowManListHandle(store, pn) {
		return new Promise((resolve, reject) => {
			store.dispatch("requestData", {
				path: "/getFollowManListData",
				data: {
					pn: pn
				}
			}).then(v => {
				store.dispatch("requestData", {
					path: "/dotting",
					data: {
						name: "getFollowManListHandle",
						api: "/getFollowManListData"
					}
				})
				resolve(v)
			}).catch(v => {
				reject(v)
			})
		})
	},
	getMyFollowerListData(store, pn) {
		return new Promise((resolve, reject) => {
			store.dispatch("requestData", {
				path: "/getMyFollowerListData",
				data: {
					pn: pn
				}
			}).then(v => {
				store.dispatch("requestData", {
					path: "/dotting",
					data: {
						name: "getMyFollowerListData",
						api: "/getMyFollowerListData"
					}
				})
				resolve(v)
			}).catch(v => {
				reject(v)
			})
		})
	},
	submitSMSLoginHandle(store, data) {
		return new Promise((resolve, reject) => {
			store.dispatch("requestData", {
				path: "/login/sms",
				data: data
			}).then(v => {
				store.dispatch("requestData", {
					path: "/dotting",
					data: {
						name: "submitSMSLoginHandle",
						api: "/login/sms"
					}
				})
				resolve(v)
			}).catch(v => {
				reject(v)
				//reject(v)
			})
		})
	},
	submitAccountLoginHandle(store, data) {
		return new Promise((resolve, reject) => {
			store.dispatch("requestData", {
				path: "/login/account",
				data: data
			}).then(v => {
				store.dispatch("requestData", {
					path: "/dotting",
					data: {
						name: "submitAccountLoginHandle",
						api: "/login/account"
					}
				})
				resolve(v)
			}).catch(v => {
				reject(v)
			})
		})
	},
	submitRegAccountHandle(store, data) {
		return new Promise((resolve, reject) => {
			store.dispatch("requestData", {
				path: "/reg/account",
				data: data
			}).then(v => {
				store.dispatch("requestData", {
					path: "/dotting",
					data: {
						name: "submitAccountLoginHandle",
						api: "/reg/account"
					}
				})
				resolve(v)
			}).catch(v => {
				reject(v)
			})
		})
	},
	submitEditPasswordHandle(store, json) {
		return new Promise((resolve, reject) => {
			store.dispatch("requestData", {
				path: "/editPassword",
				data: json
			}).then(v => {
				store.dispatch("requestData", {
					path: "/dotting",
					data: {
						name: "submitEditPasswordHandle",
						api: "/editPassword"
					}
				})
				resolve(v)
			}).catch(v => {
				reject(v)
			})
		})
	},
	submitForgotPasswordHandle(store, json) {
		return new Promise((resolve, reject) => {
			store.dispatch("requestData", {
				path: "/forgotPassword",
				data: json
			}).then(v => {
				store.dispatch("requestData", {
					path: "/dotting",
					data: {
						name: "submitForgotPasswordHandle",
						api: "/forgotPassword"
					}
				})
				resolve(v)
			}).catch(v => {
				reject(v)
			})
		})
	},
}